package org.itsolutions.javaBackup.gui.web;

import org.itsolutions.javaBackup.gui.web.admin.AdminModule;
import org.itsolutions.javaBackup.gui.web.common.ApplicationDataHolder;
import org.itsolutions.javaBackup.gui.web.common.CommonModule;
import org.itsolutions.javaBackup.ioc.AJavaBackupModule;
import org.itsolutions.javaBackup.logger.ELogLevel;
import org.itsolutions.javaBackup.logger.ILogger;
import org.itsolutions.javaBackup.logger.LoggerHelper;
import org.itsolutions.javaBackup.spi.EModule;
import org.itsolutions.javaBackup.spi.gui.IGUIWebController;

import com.google.inject.servlet.ServletScopes;

/**
 * 
 * @author Tomas Fecko
 */
public final class GUIWebModule extends AJavaBackupModule {

	private static final ILogger LOGGER = LoggerHelper.getLogger(GUIWebModule.class);
	
	@Override
	protected void configure() {
		LOGGER.log(ELogLevel.DEBUG, "Configuring the WEBGUIModule.");
		install(new AdminModule());
		install(new CommonModule());
		
		registerStartStopTask(GUIWebModuleStartStopTask.class);
		bind(IGUIWebController.class).to(GUIWebController.class).asEagerSingleton();
		bind(ApplicationDataHolder.class).in(ServletScopes.SESSION);
	}

	@Override
	protected EModule getModule() {
		return EModule.GUI_WEB;
	}
}




